<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<meta name="description" content="">
		<meta name="author" content="">

		<title>学生添加</title>
		<!-- 自定义title图标 favicon -->
		<link rel="icon" href="/favicon.ico" type="image/png">
		<!-- Bootstrap CSS -->
		<link href="/plugins/bootstrap-4.0.0/css/bootstrap.min.css"  rel="stylesheet">
		<!-- 引入 Font Awesome CSS 文件 -->
		<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" >
		<!-- 自定义样式 -->
		<link href="/helps/css/bottom.css" rel="stylesheet">
		<style type="text/css">
			/* Chart.js */
			
			@-webkit-keyframes chartjs-render-animation {
				from {
					opacity: 0.99
				}
				to {
					opacity: 1
				}
			}
			
			@keyframes chartjs-render-animation {
				from {
					opacity: 0.99
				}
				to {
					opacity: 1
				}
			}
			
			.chartjs-render-monitor {
				-webkit-animation: chartjs-render-animation 0.001s;
				animation: chartjs-render-animation 0.001s;
			}
			/*表单*/
			/*.form-container {*/
			/*	max-width: 500px;*/
			/*	max-height: 520px;*/
			/*	margin: 5px auto;*/
			/*	padding: 20px;*/
			/*	border: 1px solid #ccc;*/
			/*	border-radius: 10px;*/
			/*	background-color: #f9f9f9;*/
			/*}*/
			/*.form-group {*/
			/*	max-width: 300px;*/
			/*	width: 100%;*/
			/*	margin: 0 auto 15px;*/
			/*}*/
			/*.form-group label,*/
			/*.form-control,*/
			/*.form-check-inline,*/
			/*.btn-custom {*/
			/*	width: 100%;*/
			/*}*/
			/*.form-check-inline {*/
			/*	display: flex;*/
			/*	align-items: center;*/
			/*}*/
			/*.form-check {*/
			/*	margin-right: 15px;*/
			/*}*/
			/*.form-check-label {*/
			/*	margin-right: 10px;*/
			/*}*/
			/*.btn-custom {*/
			/*	background-color: #007bff;*/
			/*	border-color: #007bff;*/
			/*	color: #fff;*/
			/*	width: auto;*/
			/*	align-self: flex-start;*/
			/*}*/
			/*.btn-custom:hover {*/
			/*	background-color: #0056b3;*/
			/*	border-color: #004085;*/
			/*}*/
			/*.form-title {*/
			/*	text-align: center;*/
			/*	margin-bottom: 20px;*/
			/*}*/
			.form-container {
				max-width: 600px;
				margin: 20px auto;
				padding: 20px;
				border: 1px solid #ccc;
				border-radius: 10px;
				background-color: #e9f3e9;
			}
			.form-group.row {
				margin-bottom: 15px;
			}
			.form-check-inline {
				display: flex;
				align-items: center;
			}
			.form-check-input,
			.form-check-label{
				margin-right: 10px;
			}
			.btn-custom {
				background-color: #99b99a;
				border-color: #aecaaf;
				color: #fff;
				width: auto;
			}
			.btn-custom:hover {
				background-color: #689969;
				border-color: #86bd88;
			}
			.form-title {
				text-align: center;
				margin-bottom: 20px;
			}
		</style>
	</head>

	<body>
		<!--引入抽取的topbar-->
		<!--模板名：会使用thymeleaf的前后缀配置规则进行解析-->
		<div th:replace="commons/admbar::topbar"></div>

		<div class="container-fluid">
			<div class="row">
				<!--引入侧边栏-->
				<div th:replace="commons/admbar::#sidebar(activeUri='stu')"></div>

				<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
<!--					<div class="form-container">-->
<!--						<form th:action="@{/adm/stuAdd}" method="post">-->
<!--							&lt;!&ndash;提示框 &ndash;&gt;-->
<!--							<div class="alert alert-danger" role="alert" th:if="${errors!=null}">-->
<!--								<div th:text="${error.msg}" th:each="error:${errors}"></div>-->
<!--							</div>-->
<!--							<h5 class="form-title">增加学生</h5>-->

<!--							<div class="form-group ">-->
<!--								<label class="col-sm-4 col-form-label">学号</label>-->
<!--								<div class="col-sm-8">-->
<!--									<input name="stuId" type="text" class="form-control" placeholder="请输入学号" th:value="${stu!=null} ? ${stu.stuId}">-->
<!--								</div>-->
<!--							</div>-->
<!--							<div class="form-group ">-->
<!--								<label>姓名</label>-->
<!--								<input name="stuName" type="text" class="form-control" placeholder="请输入姓名" th:value="${stu!=null}?${stu.stuName}">-->
<!--							</div>-->

<!--							<div class="form-group ">-->
<!--								<label>班级</label>-->
<!--								<select class=" form-control" name="stuClass">-->
<!--									<option  th:selected="${stu!=null}?${class.className eq stu.getStuClass()}"  th:each="class:${classes}" th:value="${class.className}" th:text="${class.className}">1</option>-->
<!--								</select>-->
<!--							</div>-->
<!--							<div class="form-group ">-->
<!--								<label>性别</label><br/>-->
<!--								<div class="form-check form-check-inline">-->
<!--									<input class="form-check-input" type="radio" name="stuSex" value="1" th:checked="${stu!=null}?${stu.stuSex eq '1'}">-->
<!--									<label class="form-check-label">男</label>-->
<!--								</div>-->
<!--								<div class="form-check form-check-inline">-->
<!--									<input class="form-check-input" type="radio" name="stuSex" value="0" th:checked="${stu!=null}?${stu.stuSex eq '0'}">-->
<!--									<label class="form-check-label">女</label>-->
<!--								</div>-->
<!--							</div>-->

<!--							<div class="form-group ">-->
<!--								<label>电话</label>-->
<!--								<input name="stuTele" type="text" class="form-control" placeholder="请输入电话号码" th:value="${stu!=null}?${stu.stuTele}">-->
<!--							</div>-->
<!--							<div class="form-group">-->
<!--								<button type="submit" class="btn btn-custom" >添加</button>-->
<!--							</div>-->
<!--						</form>-->
<!--					</div>-->
					<div class="form-container">
						<form th:action="@{/adm/stuAdd}" method="post">
							<!-- 提示框 -->
							<div class="alert alert-danger" role="alert" th:if="${errors!=null}">
								<div th:each="error : ${errors}">
									<div th:text="${error.msg}"></div>
								</div>
							</div>
							<h5 class="form-title">增加学生</h5>

							<div class="form-group row">
								<label class="col-sm-2 col-form-label">学号</label>
								<div class="col-sm-10">
									<input name="stuId" type="text" class="form-control" placeholder="请输入学号" th:value="${stu!=null} ? ${stu.stuId}">
								</div>
							</div>

							<div class="form-group row">
								<label class="col-sm-2 col-form-label">姓名</label>
								<div class="col-sm-10">
									<input name="stuName" type="text" class="form-control" placeholder="请输入姓名" th:value="${stu!=null} ? ${stu.stuName}">
								</div>
							</div>

							<div class="form-group row">
								<label class="col-sm-2 col-form-label">班级</label>
								<div class="col-sm-10">
									<select  class="form-control" name="stuClass">
										<option th:selected="${stu!=null} ? ${class.className eq stu.getStuClass()}" th:each="class : ${classes}" th:value="${class.className}" th:text="${class.className}">1</option>
									</select>
								</div>
							</div>

							<div class="form-group row">
								<label class="col-sm-2 col-form-label">性别</label>
								<div class="col-sm-10">
									<div class="form-check form-check-inline">
										<input class="form-check-input" type="radio" name="stuSex" id="male" value="1" th:checked="${stu!=null} ? ${stu.stuSex eq '1'}">
										<label class="form-check-label" for="male">男</label>
<!--									</div>-->
<!--									<div class="form-check form-check-inline">-->
										<input class="form-check-input" type="radio" name="stuSex" id="female" value="0" th:checked="${stu!=null} ? ${stu.stuSex eq '0'}">
										<label class="form-check-label" for="female">女</label>
									</div>
								</div>
							</div>

							<div class="form-group row">
								<label  class="col-sm-2 col-form-label">电话</label>
								<div class="col-sm-10">
									<input name="stuTele"type="text" class="form-control" placeholder="请输入电话号码" th:value="${stu!=null} ? ${stu.stuTele}">
								</div>
							</div>

							<div class="form-group row">
								<div class="col-sm-2"></div>
								<div class="col-sm-10">
									<button type="submit" class="btn btn-custom">添加</button>
								</div>
							</div>
						</form>
					</div>
				</main>
			</div>
		</div>

		<script type="text/javascript" src="/helps/js/jquery-3.7.1.min.js" ></script>
		<script src="https://unpkg.com/@popperjs/core@2"></script>
		<script type="text/javascript" src="/plugins/bootstrap-4.0.0/js/bootstrap.min.js" ></script>

		<!-- Icons -->
		<script type="text/javascript" src="/helps/js/feather.min.js" ></script>
		<script>
			feather.replace();
		</script>

	</body>

</html>